package com.buaa.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "instrument")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Instrument implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue // MySQL : auto_increment(default)
	@Column(name = "id")
	private Integer id; // id

	@Column(name = "unit_name", columnDefinition = "varchar(50) default ''")
	private String unit_name; // 单位名称（1）

	// @ManyToOne(targetEntity = Institution.class, cascade = CascadeType.ALL)
	// @JoinColumn(name="unit_code",referencedColumnName="code")
	@Column(name = "unit_code", columnDefinition = "bigint(13) default -1")
	private Long unit_code; // 单位编码（2）

	@Column(name = "name_zh", columnDefinition = "varchar(50) default ''")
	private String name_zh; // 仪器中文名称(17)

	@Column(name = "name_en", columnDefinition = "varchar(100) default ''")
	private String name_en; // 仪器英文名称(21)

	@Column(name = "type", columnDefinition = "tinyint(4) default -1")
	private Byte type; // 类型（3）

	@Column(name = "model", columnDefinition = "varchar(70) default ''")
	private String model; // 型号（4）

	@Column(name = "buy_time", columnDefinition = "date default '1000-01-01'")
	@Temporal(TemporalType.DATE)
	private Date buy_time; // 购置时间（5）

	@Column(name = "org_value", columnDefinition = "float default -1")
	private Float org_value; // 原值金额（6）

	@Column(name = "currency", columnDefinition = "varchar(10) default ''")
	private String currency; // 币种(7)

	@Column(name = "rmb_value", columnDefinition = "float default -1")
	private Float rmb_value; // 外币折合成当时的人民币值（8）

	// @Column(name = "qualification", columnDefinition = "varchar(2000) default
	// ''")
	// private String qualification; // 主要技术指标（9）
	//
	// @Column(name = "accessory", columnDefinition = "varchar(1200) default
	// ''")
	// private String accessory; // 主要附件（10）
	//
	// @Column(name = "function", columnDefinition = "varchar(1200) default ''")
	// private String function; // 功能/应用范围(11)

	@Column(name = "weekday", columnDefinition = "varchar(30) default ''")
	private String weekday; // 接待时间（工作日）(12)

	@Column(name = "depart_name", columnDefinition = "varchar(60) default ''")
	private String depart_name; // 仪器所在部门(13)

	@Column(name = "contact_name", columnDefinition = "varchar(20) default ''")
	private String contact_name; // 仪器设施联系人姓名(14)

	@Column(name = "contact_phone", columnDefinition = "varchar(50) default ''")
	private String contact_phone; // 仪器设备联系人电话(15)

	@Column(name = "contact_fax", columnDefinition = "varchar(30) default ''")
	private String contact_fax; // 仪器设备联系人传真(29)

	@Column(name = "contact_email", columnDefinition = "varchar(50) default ''")
	private String contact_email; // 仪器设备联系人email(30)

	@Column(name = "contact_addr", columnDefinition = "varchar(230) default ''")
	private String contact_addr; // 仪器设备联系人通讯地址(31)

	@Column(name = "contact_zipcode", columnDefinition = "char(6) default ''")
	private String contact_zipcode; // 仪器设备联系人邮编(32)

	@Column(name = "pic", columnDefinition = "varchar(120) default ''")
	private String pic; // 仪器图片（16）

	@Column(name = "home", columnDefinition = "varchar(20) default ''")
	private String home; // 生产国家(18)

	@Column(name = "status", columnDefinition = "varchar(6) default ''")
	private String status; // 仪器使用状态(19)

	@Column(name = "manage_code", columnDefinition = "varchar(70) default ''")
	private String manage_code; // 资产管理编号(20)

	@Column(name = "raise", columnDefinition = "float default -1")
	private Float raise; // 自筹（22）

	@Column(name = "type_code", columnDefinition = "varchar(10) default ''")
	private String type_code; // 仪器分类编码(23)

	@Column(name = "manufacturer", columnDefinition = "varchar(80) default ''")
	private String manufacturer; // 制造商(24)

	@Column(name = "other", columnDefinition = "float default -1")
	private Float other; // 其他(25)

	@Column(name = "province", columnDefinition = "char(4) default ''")
	private String province; // 仪器所在地区（省）(36)

	@Column(name = "city", columnDefinition = "varchar(10) default ''")
	private String city; // 仪器所在地区（市）(26)

	@Column(name = "base_type", columnDefinition = "varchar(40) default ''")
	private String base_type; // 所在研发基地类型（27）

	@Column(name = "base_name", columnDefinition = "varchar(100) default ''")
	private String base_name; // 所在研发基地名称（28）

	@Column(name = "is_import", columnDefinition = "bit(1) default 0")
	private Boolean is_import; // 是否进口（33）

	@Column(name = "industry_type", columnDefinition = "varchar(270) default ''")
	private String industry_type; // 服务行业类别(34)

	@Column(name = "subject", columnDefinition = "varchar(150) default ''")
	private String subject; // 主要学科领域 (35)

	// @Column(name = "service_content", columnDefinition = "varchar(2400)
	// default ''")
	// private String service_content; // 仪器服务内容(37)

	@Column(name = "lng", columnDefinition = "float(9,6) default 0")
	private Float lng;

	@Column(name = "lat", columnDefinition = "float(9,6) default 0")
	private Float lat;

	public Instrument() {
	}

	public Instrument(Integer id, String unit_name, Long unit_code, String name_zh, String name_en, Byte type,
			String model, Date buy_time, Float org_value, String currency, Float rmb_value, String weekday,
			String depart_name, String contact_name, String contact_phone, String contact_fax, String contact_email,
			String contact_addr, String contact_zipcode, String pic, String home, String status, String manage_code,
			Float raise, String type_code, String manufacturer, Float other, String province, String city,
			String base_type, String base_name, Boolean is_import, String industry_type, String subject, Float lng,
			Float lat) {
		super();
		this.id = id;
		this.unit_name = unit_name;
		this.unit_code = unit_code;
		this.name_zh = name_zh;
		this.name_en = name_en;
		this.type = type;
		this.model = model;
		this.buy_time = buy_time;
		this.org_value = org_value;
		this.currency = currency;
		this.rmb_value = rmb_value;
		this.weekday = weekday;
		this.depart_name = depart_name;
		this.contact_name = contact_name;
		this.contact_phone = contact_phone;
		this.contact_fax = contact_fax;
		this.contact_email = contact_email;
		this.contact_addr = contact_addr;
		this.contact_zipcode = contact_zipcode;
		this.pic = pic;
		this.home = home;
		this.status = status;
		this.manage_code = manage_code;
		this.raise = raise;
		this.type_code = type_code;
		this.manufacturer = manufacturer;
		this.other = other;
		this.province = province;
		this.city = city;
		this.base_type = base_type;
		this.base_name = base_name;
		this.is_import = is_import;
		this.industry_type = industry_type;
		this.subject = subject;
		this.lng = lng;
		this.lat = lat;
	}

	public Instrument(Integer id, String name_zh, Float lng, Float lat) {
		this.id = id;
		this.name_zh = name_zh;
		this.lng = lng;
		this.lat = lat;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUnit_name() {
		return unit_name;
	}

	public void setUnit_name(String unit_name) {
		this.unit_name = unit_name;
	}

	public Long getUnit_code() {
		return unit_code;
	}

	public void setUnit_code(Long unit_code) {
		this.unit_code = unit_code;
	}

	public String getName_zh() {
		return name_zh;
	}

	public void setName_zh(String name_zh) {
		this.name_zh = name_zh;
	}

	public String getName_en() {
		return name_en;
	}

	public void setName_en(String name_en) {
		this.name_en = name_en;
	}

	public Byte getType() {
		return type;
	}

	public void setType(Byte type) {
		this.type = type;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public Date getBuy_time() {
		return buy_time;
	}

	public void setBuy_time(Date buy_time) {
		this.buy_time = buy_time;
	}

	public Float getOrg_value() {
		return org_value;
	}

	public void setOrg_value(Float org_value) {
		this.org_value = org_value;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public Float getRmb_value() {
		return rmb_value;
	}

	public void setRmb_value(Float rmb_value) {
		this.rmb_value = rmb_value;
	}

	public String getWeekday() {
		return weekday;
	}

	public void setWeekday(String weekday) {
		this.weekday = weekday;
	}

	public String getDepart_name() {
		return depart_name;
	}

	public void setDepart_name(String depart_name) {
		this.depart_name = depart_name;
	}

	public String getContact_name() {
		return contact_name;
	}

	public void setContact_name(String contact_name) {
		this.contact_name = contact_name;
	}

	public String getContact_phone() {
		return contact_phone;
	}

	public void setContact_phone(String contact_phone) {
		this.contact_phone = contact_phone;
	}

	public String getContact_fax() {
		return contact_fax;
	}

	public void setContact_fax(String contact_fax) {
		this.contact_fax = contact_fax;
	}

	public String getContact_email() {
		return contact_email;
	}

	public void setContact_email(String contact_email) {
		this.contact_email = contact_email;
	}

	public String getContact_addr() {
		return contact_addr;
	}

	public void setContact_addr(String contact_addr) {
		this.contact_addr = contact_addr;
	}

	public String getContact_zipcode() {
		return contact_zipcode;
	}

	public void setContact_zipcode(String contact_zipcode) {
		this.contact_zipcode = contact_zipcode;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public String getHome() {
		return home;
	}

	public void setHome(String home) {
		this.home = home;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getManage_code() {
		return manage_code;
	}

	public void setManage_code(String manage_code) {
		this.manage_code = manage_code;
	}

	public Float getRaise() {
		return raise;
	}

	public void setRaise(Float raise) {
		this.raise = raise;
	}

	public String getType_code() {
		return type_code;
	}

	public void setType_code(String type_code) {
		this.type_code = type_code;
	}

	public String getManufacturer() {
		return manufacturer;
	}

	public void setManufacturer(String manufacturer) {
		this.manufacturer = manufacturer;
	}

	public Float getOther() {
		return other;
	}

	public void setOther(Float other) {
		this.other = other;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getBase_type() {
		return base_type;
	}

	public void setBase_type(String base_type) {
		this.base_type = base_type;
	}

	public String getBase_name() {
		return base_name;
	}

	public void setBase_name(String base_name) {
		this.base_name = base_name;
	}

	public Boolean getIs_import() {
		return is_import;
	}

	public void setIs_import(Boolean is_import) {
		this.is_import = is_import;
	}

	public String getIndustry_type() {
		return industry_type;
	}

	public void setIndustry_type(String industry_type) {
		this.industry_type = industry_type;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public Float getLng() {
		return lng;
	}

	public void setLng(Float lng) {
		this.lng = lng;
	}

	public Float getLat() {
		return lat;
	}

	public void setLat(Float lat) {
		this.lat = lat;
	}

	@Override
	public String toString() {
		return "Instrument [id=" + id + ", unit_name=" + unit_name + ", unit_code=" + unit_code + ", name_zh=" + name_zh
				+ ", name_en=" + name_en + ", type=" + type + ", model=" + model + ", buy_time=" + buy_time
				+ ", org_value=" + org_value + ", currency=" + currency + ", rmb_value=" + rmb_value + ", weekday="
				+ weekday + ", depart_name=" + depart_name + ", contact_name=" + contact_name + ", contact_phone="
				+ contact_phone + ", contact_fax=" + contact_fax + ", contact_email=" + contact_email
				+ ", contact_addr=" + contact_addr + ", contact_zipcode=" + contact_zipcode + ", pic=" + pic + ", home="
				+ home + ", status=" + status + ", manage_code=" + manage_code + ", raise=" + raise + ", type_code="
				+ type_code + ", manufacturer=" + manufacturer + ", other=" + other + ", province=" + province
				+ ", city=" + city + ", base_type=" + base_type + ", base_name=" + base_name + ", is_import="
				+ is_import + ", industry_type=" + industry_type + ", subject=" + subject + ", lng=" + lng + ", lat="
				+ lat + "]";
	}

}
